﻿@using Microsoft.AspNetCore.Authentication
@model ExternalLoginListViewModel
@inject IAuthenticationSchemeProvider SchemeProvider
<h4>Use another service to log in.</h4>
<hr />
@{
    var schemes = await SchemeProvider.GetAllSchemesAsync();
    var loginProviders = schemes.ToList();
    if (!loginProviders.Any())
    {
        <div>
            <p>
                There are no external authentication services configured. See <a href="http://go.microsoft.com/fwlink/?LinkId=313242">this article</a>
                for details on setting up this ASP.NET application to support logging in via external services.
            </p>
        </div>
    }
    else
    {
        <form asp-controller="Account" asp-action="ExternalLogin" asp-route-returnurl="@ViewBag.ReturnUrl" method="post" class="form-horizontal" role="form">
            <div id="socialLoginList">
                <p>
                    @foreach (var p in loginProviders)
                    {
                        <button type="submit" class="btn btn-default" id="@p.Name" name="provider" value="@p.Name" title="Log in using your @p.Name account">@p.Name</button>
                    }
                </p>
            </div>
        </form>
    }
}